<?php
class Lion_View_Helper_TopMenu extends Zend_Controller_Action_Helper_Abstract
{
    private $_view;
	public function setView($view) {
		$this->_view = $view;
	}
	
	public function topMenu()
    {  
        /*below 2 lines were added since it was giving an error saying class not found when trying to go inside excusion items */
        require_once('../application/default/models/Tour.php');
        require_once('../application/default/models/Aboutcountry.php');
    	$model_tour = new Tour();        
    	$model_aboutcountry = new Aboutcountry();         
       /*below line was added coz it was saying class not found when it was loading the page*/
        require_once('../application/default/models/Excursion.php');        
        $model_excursion = new Excursion();
    	$tour_arr = $model_tour->getTourDetails();        
    	$rec_arr = $model_aboutcountry->listPageContentAboutCountry(); 
        $excursion_arr = $model_excursion->getExcursionDetails()        
    	//print_r($rec_arr);
?> 	
		<ul>
			<li class="1st-mnu"><a href="/index/"><?php echo $this->_view->translate('%Home','home'); ?></a></li>
			<li><a href=""><?php echo $this->_view->translate('%About Us','topnav'); ?></a>
                            <ul>
                                <li><a href="/index/about#map1"><?php echo $this->_view->translate('%About Us','topnav'); ?></a></li>
                                <li><a href="/index/about2#map1"><?php echo $this->_view->translate('%Why travel with us','topnav'); ?></a></li>
                            </ul>
                        </li>
			<li><a href="#"><?php echo $this->_view->translate('%About Sri Lanka','topnav'); ?></a>
		  		<ul>
                                    <li><a href="/aboutcountry/map#map1">View Map</a></li>
					<?php
						foreach ($rec_arr as $rec_entry) :
					?>
		  			<li><a href="/aboutcountry/view/page_id/<?php echo $rec_entry['page_id']; ?>#map1"><?php echo $rec_entry['title']; ?></a></li>
			 		<?php 
			 			endforeach; 
			 		?>	
		  		</ul>		
			</li>
			<li><a href="/tour/view/"><?php echo $this->_view->translate('%Tours','topnav'); ?></a></li>
			<li><a href="/hotel/view/"><?php echo $this->_view->translate('%Hotels','topnav'); ?></a></li>
			<li><a href="/excursion/view/"><?php echo $this->_view->translate('%Excursions','topnav'); ?></a></li>
                        <li><a href="#"><?php echo $this->_view->translate('%Destinations','topnav'); ?></a>
                            <ul>
                                <li><a href="/destinations/view/cid/1"><?php echo $this->_view->translate('%Sri Lanka','topnav'); ?></a></li>
                                <li><a href="/destinations/view/cid/2"><?php echo $this->_view->translate('%Maldives','topnav'); ?></a></li>
                            </ul>
                        </li>
			<li><a href="/index/reservations/"><?php echo $this->_view->translate('%Reservations','topnav'); ?></a></li>
			<li><a href="/index/contact/"><?php echo $this->_view->translate('%Contact Us','home'); ?></a></li>		
	  	</ul>
	  	<br style="clear: left" />
<?php	  	
	}
}		
?>